#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@File    :   eval_param.py
@Time    :   2020/11/25
@Author  :   wenke wang
@Version :   1.0
@Desc    :   ICVD10年风险评估参数
'''

# here put the import lib
from decimal import Decimal

class IcvdEvalParam():
    """
    ICVD10年风险评估参数
    """
    def __init__(self, age, gender, height, weight, dm, smoking, sbp, tc):
        self.__age = int(age)
        self.__gender = gender
        self.__height = int(height)
        self.__weight = Decimal(str(weight))
        self.__dm = int(dm)
        self.__smoking = int(smoking)
        self.__sbp = int(sbp)        
        self.__tc = Decimal(str(tc))

    @property
    def age(self):
        return self.__age    
    @age.setter
    def age(self, val):
        self.__age = int(val)

    @property
    def gender(self):
        return self.__gender
    @gender.setter
    def gender(self, val):
        self.__gender = val
    
    @property
    def height(self):
        return self.__height
    @height.setter
    def height(self, val):
        self.__height = int(val)
    
    @property
    def weight(self):
        return self.__weight
    @weight.setter
    def weight(self, val):
        self.__weight = Decimal(str(val))

    @property
    def bmi(self):
        return (self.__weight / Decimal(str((self.__height / 100) ** 2))).quantize(Decimal("0.00"))
    
    @property
    def dm(self):
        return self.__dm
    @dm.setter
    def dm(self, val):
        self.__dm = int(val)
    
    @property
    def smoking(self):
        return self.__smoking
    @smoking.setter
    def smoking(self, val):
        self.__smoking = int(val)

    @property
    def sbp(self):
        return self.__sbp
    @sbp.setter
    def sbp(self, val):
        self.__sbp = int(val)
    
    @property
    def tc(self):
        return self.__tc
    @tc.setter
    def tc(self, val):
        self.__tc = Decimal(str(val))

